/*
 *  utils.h
 *  Angel&Demon
 *
 *  Created by Si-Mohamed Lamraoui on 04/11/10.
 *  Copyright 2010 UJF. All rights reserved.
 *
 */

#ifndef __UTILS_H__
#define __UTILS_H__

#include <stdio.h>
#include <stdlib.h>

#ifdef PSP
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <psputils.h>
#else
#include <sys/time.h>
#include "SDL.h"
#include <SDL_ttf/SDL_ttf.h>
#endif


#define TRUE 1
#define FALSE 0

typedef struct timer {
	struct timeval start;
	struct timeval end;
} mytimer_t;


SDL_Surface *load_image(const char *path);
SDL_Surface *load_colorkey_image(const char *path);

void blit_int(int number, int x, int y, TTF_Font *font, SDL_Surface *screen);
void blit_text(const char *str, int x, int y, TTF_Font *font, SDL_Surface *screen);
void blit_image(SDL_Surface *image, int x, int y, SDL_Surface *screen);

void timer_restart(mytimer_t *t);
int timer_state(mytimer_t *t, int duration);

void error(const char *err, char *arg);



#endif